var e = require;
var t = module;
var o = exports;
var n,
    i =
        (this && this.__extends) ||
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            n(e, t);
            function o() {
                this.constructor = e;
            }
            e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o());
        }),
    r =
        (this && this.__decorate) ||
        function (e, t, o, n) {
            var i,
                r = arguments.length,
                a = r < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, o, n);
            else
                for (var c = e.length - 1; c >= 0; c--)
                    (i = e[c]) && (a = (r < 3 ? i(a) : r > 3 ? i(t, o, a) : i(t, o)) || a);
            return r > 3 && a && Object.defineProperty(t, o, a), a;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = e("UIManager"),
    c = e("UIConfig"),
    u = cc._decorator,
    s = u.ccclass,
    p = u.property,
    d = u.menu,
    l = u.requireComponent,
    f = (function (e) {
        i(t, e);
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            t.uiName = "";
            return t;
        }
        Object.defineProperty(t.prototype, "emUiSelect", {
            get: function () {
                return c.UIID[this.uiName] || -1;
            },
            set: function (e) {
                this.uiName = c.UIID[e];
            },
            enumerable: !1,
            configurable: !0
        });
        Object.defineProperty(t.prototype, "autoName", {
            get: function () {
                return !1;
            },
            set: function () {
                var e = this.node.name.toLocaleLowerCase(),
                    t = this.node.name;
                (-1 === e.indexOf("_btn") && 0 !== e.indexOf("btn")) || (t = t.substring(e.indexOf("btn") + 3));
                -1 === t.indexOf("UI") && (t = "UI" + t);
                this.uiName = t;
            },
            enumerable: !1,
            configurable: !0
        });
        t.prototype.onLoad = function () {
            this.node.on(cc.Node.EventType.TOUCH_END, this._onTouchEnd, this);
        };
        t.prototype._onTouchEnd = function () {
            this.uiName.length > 0 && a.default.open(a.default.getUiid(this.uiName));
        };
        r([p()], t.prototype, "uiName", void 0);
        r([p({type: cc.Enum(c.UIID)})], t.prototype, "emUiSelect", null);
        r([p({tooltip: "对_btn,btn自动处理成对应UI"})], t.prototype, "autoName", null);
        return r([s, d("Common/UI/UIBtnOpen"), l(cc.Button)], t);
    })(cc.Component);
o.default = f;
